<template>
  <div class="index">
    <img class="logo" src="/static/img/home-logo.png" />
    <div>
      <div class="main">
        <div
          class="main-item"
          v-for="(item, index) in tabList"
          :key="index"
          @click="toMian(item.path)"
        >
          <img class="main-item-img" :src="item.img" />
          <span class="text">{{ item.name }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tabList: [
        {
          name: "基本情况",
          img: require("../../../static/img/1.png"),
          path: "/jbqk",
        },
        {
          name: "工程管理",
          img: require("../../../static/img/2.png"),
          path: "/gcgl",
        },
        {
          name: "财务融资",
          img: require("../../../static/img/3.png"),
          path: "/cwrz",
        },
        {
          name: "制度建设",
          img: require("../../../static/img/4.png"),
          path: "/zdjs",
        },
        {
          name: "资产管理",
          img: require("../../../static/img/5.png"),
          path: "/zcgl",
        },
        {
          name: "招标投标",
          img: require("../../../static/img/6.png"),
          path: "/zbtb",
        },
        {
          name: "党风廉政",
          img: require("../../../static/img/7.png"),
          path: "/dflz",
        },
        {
          name: "实时动态",
          img: require("../../../static/img/8.png"),
          path: "/ssdt",
        },
      ],
    };
  },
  created(){
    if(!this.$store.state.isCall){
      this.call()
    }
  },
  methods: {
    toMian(path) {
      this.$router.push({ path: "/main" + path });
    },
    //统计
    async call(){
     const {code} = await this.$api.total.call()
     if(!code){
       this.$store.commit('updateIsCall')
     }
    }
  },
};
</script>

<style lang="scss" scoped>
.index {
  display: flex;
  justify-content: center;
  overflow: hidden;
  height: 100%;
  background: url("/static/img/backgroun.png") no-repeat;
  background-size: 100% 100%;
  position: relative;
  .logo {
    position: absolute;
    width: 320px;
    top: 95px;
    right: 80px;
  }
  .main {
    width: 610px;
    height: 515px;
    margin-top: 510px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    .main-item {
      box-shadow: 0 10px 20px #474446;
      overflow: hidden;
      background: linear-gradient(to bottom, #add0e8, #fff, #aacee4);
      border-radius: 10px;
      flex-shrink: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 285px;
      height: 100px;
      position: relative;
      /* 			&:after {
					position: absolute;
					top: 37px;
					left: 108px;
					content: '';
					height: 40px;
					width: 2px;
					background-color: #ccc;
				} */
      /* 	&::before {
					position: absolute;
					top: 100px;
					left: -4px;
					content: '';
					height: 15px;
					width: 290px;
					background-color: #ccc;
				} */

      .main-item-img {
        margin-right: 22px;
        // height: 40px;
        width: 48px;
      }
      .text {
        font-size: 30px;
      }
    }
  }

  .inupt {
    position: relative;
    line-height: 50px;
    height: 50px;
    width: 380px;
    border-radius: 35px;
    background-color: #fff;
    padding-left: 20px;
    box-sizing: border-box;

    input {
      height: 50px;
      line-height: 50px;
      font-size: 25px;
    }
  }
}
</style>
